- 
                Notifications
    
You must be signed in to change notification settings  - Fork 669
 
feat: DIS-373 dynamo KVBM connector API integration with TRTLLM #2544
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
    Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    fc0fcb0    to
    8eeee78      
    Compare
  
            
          
                lib/bindings/python/rust/llm/block_manager/vllm/connector/trtllm_leader.rs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                lib/bindings/python/rust/llm/block_manager/vllm/connector/trtllm_leader.rs
          
            Show resolved
            Hide resolved
        
              
          
                lib/bindings/python/rust/llm/block_manager/vllm/connector/trtllm_leader.rs
              
                Outdated
          
            Show resolved
            Hide resolved
        
              
          
                lib/bindings/python/rust/llm/block_manager/vllm/connector/trtllm_leader.rs
              
                Outdated
          
            Show resolved
            Hide resolved
        
      
              
                    jthomson04
  
              
              reviewed
              
                  
                    Aug 20, 2025 
                  
              
              
            
            
6f41dd4    to
    29e9507      
    Compare
  
    e16d1ec    to
    85319a1      
    Compare
  
    Signed-off-by: richardhuo-nv <[email protected]>
Signed-off-by: richardhuo-nv <[email protected]>
Signed-off-by: richardhuo-nv <[email protected]>
integrate vllm add doc fix blocking fix fix fix fix fix fix fmt fix Signed-off-by: richardhuo-nv <[email protected]>
Signed-off-by: richardhuo-nv <[email protected]>
Signed-off-by: richardhuo-nv <[email protected]>
Signed-off-by: richardhuo-nv <[email protected]>
Signed-off-by: richardhuo-nv <[email protected]>
f9c0ea1    to
    8c7dd17      
    Compare
  
    Signed-off-by: richardhuo-nv <[email protected]>
              
                    oandreeva-nv
  
              
              approved these changes
              
                  
                    Aug 29, 2025 
                  
              
              
            
            
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
| 
           @oandreeva-nv, ⭐3 XP earned, 🏆First Code Review Done completed, 💪Level 5 achieved! [Details]  | 
    
Signed-off-by: richardhuo-nv <[email protected]>
              
                    ziqifan617
  
              
              approved these changes
              
                  
                    Aug 29, 2025 
                  
              
              
            
            
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Signed-off-by: richardhuo-nv <[email protected]>
              
                    richardhuo-nv
  
              
              commented
              
                  
                    Aug 29, 2025 
                  
              
              
            
            
              
                    nnshah1
  
              
              reviewed
              
                  
                    Aug 30, 2025 
                  
              
              
            
            
        
          
                lib/bindings/python/rust/llm/block_manager/vllm/connector/trtllm_worker.rs
          
            Show resolved
            Hide resolved
        
      
              
                    nnshah1
  
              
              reviewed
              
                  
                    Aug 30, 2025 
                  
              
              
            
            
              
                    nnshah1
  
              
              approved these changes
              
                  
                    Aug 30, 2025 
                  
              
              
            
            
Signed-off-by: richardhuo-nv <[email protected]>
    
  jasonqinzhou 
      pushed a commit
      that referenced
      this pull request
    
      Aug 30, 2025 
    
    
      
  
    
      
    
  
Signed-off-by: richardhuo-nv <[email protected]> Signed-off-by: Jason Zhou <[email protected]>
    
  KrishnanPrash 
      pushed a commit
      that referenced
      this pull request
    
      Sep 2, 2025 
    
    
      
  
    
      
    
  
Signed-off-by: richardhuo-nv <[email protected]> Signed-off-by: Krishnan Prashanth <[email protected]>
    
  dillon-cullinan 
      pushed a commit
      that referenced
      this pull request
    
      Sep 5, 2025 
    
    
      
  
    
      
    
  
Signed-off-by: richardhuo-nv <[email protected]>
    
  nnshah1 
      pushed a commit
      that referenced
      this pull request
    
      Sep 8, 2025 
    
    
      
  
    
      
    
  
Signed-off-by: richardhuo-nv <[email protected]> Signed-off-by: nnshah1 <[email protected]>
  This was referenced Sep 17, 2025 
      
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Overview:
Dynamo KVBM connector API integration with TRTLLM, including fixes after merging the connector API vLLM integration and addressing comments from #2440
Details:
The PR is based on the ongoing changes from NVIDIA/TensorRT-LLM#7228, which added TRT-LLM connector API compatibility.
Changes in this PR:
Worker → Leader: send bytes_per_block.
Leader → Worker: send num_host_blocks and num_disk_blocks.
1). When the leader calls update_state_after_alloc, no num_external_tokens is passed. For now, a HashMap is used to track each request’s num_external_tokens when calling get_num_new_matched_tokens.
2). build_connector_metadata now uses a new implementation of apply_scheduler_output, namely apply_scheduler_output_with_computed_position, to trigger offloading. This change is required because TRT-LLM’s scheduler output does not include the number of scheduled tokens, so offloading decisions must be based on the computed position.
Issues:
A separate Python module and Rust crate will need to be built specifically for TRT-LLM. For now, TRT-LLM is included in vllm_integration to reuse some core KVBM integration code.
New changes after last review:
in vLLM, the engine core will register kv cache in workers first and then initialize the leader, the engine's readiness depends on the scheduler's readiness, so the worker initialization need to be non-blocking, and the scheduler's initialization need to be blocking.
in TRTLLM, the engine core will initialize the leader and register kv cache in workers at the same time and in the same process, he engine's readiness depends on the worker's readiness, so the worker initialization need to be blocking, and the scheduler's initialization need to be non-blocking.
Where should the reviewer start?
The reviewer could start with kvbm_connector_leader.py and kvbm_connector_worker.py. And then look into the rust bindings inside the trtllm_leader.rs and trtllm_worker.rs implementation.
Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)